For example in (1,2,2,3), the second and third gametes are IBD.
Note that label starts at ZERO. When converting label to vector, if the label is invalid the returned vector has NA elements.
allVec(ngam)
vec2label(vec)
label2vec(label, ngam)
fgl2vec(vec)
## Vectors for all labels
allVec( ngam = 4 )
## Convert vector to label, with renumbering or without
vec2label( c(1,1,1,3))
vec2label( c(1,1,1,2))
## Convert label to vector
label2vec( 1, ngam = 4 )
label2vec( 2, ngam = 4 )
label2vec( 2, ngam = 6 )
## renumbering
fgl2vec( c(1,1,1,3) )
fgl2vec( c(5,1,5,6) )
Run the code above in your browser using DataLab